const generateButtons = data => {
  console.log('generateButtons---', data);
  return new Promise((resolve, reject) => {
    if (data.auth && data.auth.length) {
      let permissionButtons = [];
      data.auth.map(item => {
        if (item.child && item.child.length) {
          item.child.map(subItem => {
            permissionButtons.push(subItem.authorityName);
          });
        }
      });
      resolve(permissionButtons);
    } else {
      resolve([]);
    }
  });
};

export default generateButtons;
